The present invention relates generally to computer that include cache memory and, more particularly, to a transportable memory apparatus that includes cache memory and associated methods of initializing a computer having a transportable memory apparatus.
Generally, computers or computer systems have associated devices for storing data. The data may be stored on a relatively safe and recoverable non-volatile storage device. An example of a non-volatile storage device is a hard disk drive. The techniques or procedures for storing data on non-volatile storage devices are well known in the art. As the volume of data stored on non-volatile storage devices increases, however, so does the concern for data integrity and reliability.
When a file is written to a hard disk drive, the operating system transfers the data in the file generally in sections called blocks. A block of data is first sent to a memory controller, such as an integrated device electronics (IDE) controller or a small computer standard interface (SCSI) controller. After receiving the block of data, the controller sends an acknowledgement of receipt to the operating system. Upon receiving this acknowledgement, the operating system then considers the block to be safely stored in the storage device.
In a controller without cache memory, the memory controller transfers the data immediately to the storage device before an acknowledgement is sent back to the operating system. Many higher-end controllers have cache memories. Cache memory is higher-speed memory that stores data that has recently been retrieved from or is in the process of being transferred to a non-volatile storage device, thereby saving time by not requiring that the non-volatile storage device be accessed if the data is needed again in the near future. A memory controller (also termed a caching controller) that is associated with a cache memory sends, an acknowledgement to the operating system after the data is stored in the cache memory without waiting for the data to be stored in a non-volatile storage device.
Caching controllers generally employ one of two methods to handle data that has been written to a storage device, write-through cache and write-back cache. A caching controller employing the first method, write-through cache, writes the block of data to two locations once the data is received, that is, the caching controller writes the data to both the cache memory and to the storage device. Because the data is written to cache memory, the data can be quickly accessed again if needed for later use. However, the data is also simultaneously stored in a safe manner in the storage device. Unfortunately, the time that is required to write the data from the operating system to the storage device according to a write-through cache method is greater than the time to write data directly to a storage device without passing through a caching controller. In fact, the total time to write data according to the write-through cache method is equal to the time to write data to the cache memory plus the time to write data to a storage device.
The second method, write-back cache, reduces the time requirements of the first method by writing the block of data only to the cache memory, instead of to both cache memory and the storage device. Therefore, the total time to write data is only the time required to write data to the cache memory. However, the data will only be written from the cache memory to the non-volatile storage device when the cache memory is full or when activity on the controller is low. Unfortunately, the write-back cache method necessitates that the storage device will go through periods of not containing any new or updated blocks of data with the new or updated blocks of data being, instead, maintained by the cache memory. As such, if the power supply fails, then the new blocks of data will be lost and non-recoverable since the cache memory is volatile. This loss of data is particularly problematic since the memory controller has previously sent an acknowledgement to the operating system indicating that the data was received by the storage device without providing any indication that the data had only been stored in cache memory. Upon receiving the acknowledgment, the operating system is no longer obligated to maintain the data and therefore cannot be relied upon to recover any data lost in cache memory.
Cache memory therefore has a central flaw. When power to the caching controller fails or is interrupted for any reason, the contents of the cache memory is generally lost or corrupted. As the size of cache memories increase, the potential for data loss also increases. Numerous techniques for data recovery and data storage have been developed to overcome this problem. One such attempt to resolve this problem is to have a battery backup for the cache memory.
One example of a conventional computer system 100 that includes a cache memory system 150 is depicted in FIG. 1. The cache memory system 150 is powered by the system power supply 130 and communicates with the computer system via system bus 115. The cache memory system includes cache memory 200, typically configured as a cache array, such as an Intel 21256 Dynamic Random Access Memory (DRAM). The cache memory system also includes a cache controller 160 for interacting with the central processing unit (CPU) 110 of the computer system and for generally controlling the operations of the cache memory system. As depicted in FIG. 1, the cache memory system also includes a refresh unit 177 that periodically refreshes the contents of the cache memory and a battery unit 176 for providing auxiliary power to the cache memory. In order to control the manner in which the cache memory is refreshed and the manner in which auxiliary power is provided to the cache memory, the cache memory system can also include a selector 180 that operates under control of the cache controller 160. As such, the cache memory system can be designed such that the battery unit provides power to the cache memory if the system power supply fails or if power to the cache memory is otherwise interrupted. As such, the cache memory system can retain the contents of the cache memory until such time that the power failure is rectified and the computer system can again be powered on, thereby permitting the contents of the cache memory to be transferred to main memory 120, typically a non-volatile memory device, for storage.
It is also advantageous for the cache memory 200 along with the associated battery and refresh units 176, 177 (collectively designated as 170 in FIG. 1) to be modular so as to be moved from one computer system and installed in another computer system. As such, in instances in which the cache controller 160 fails while the cache memory is dirty, the battery unit can supply auxiliary power to the cache memory in order to retain the contents of the cache memory while the modular cache memory and associated battery unit are removed from the computer system that has experienced the failure and are installed in another computer system. Upon powering up the new computer system, the dirty data can be flushed from the cache memory to main memory 120 such that no data is lost.
As a result of the removal of the cache memory from a first computer system and the installation of the cache memory in a second computer system, a number of problems arise in the manner in which the second computer system is initialized so as to identify the newly installed cache memory, to detect if the newly installed cache memory has dirty data, and to appropriately flush the dirty data to a non-volatile storage device of a second computer system. If the cache memory is not identified and the dirty data is not appropriately flushed, data may be lost or the integrity of the data may otherwise be compromised, notwithstanding removal of the cache memory from the computer system that has experienced the failure and the installation of the cache memory in a different computer system.
A transportable memory apparatus including cache memory is provided that is capable of being removed from a first computer system and installed within a second computer system. According to the present invention, the transportable memory apparatus includes a control bus that provides appropriate signals such that the presence and status of the transportable memory apparatus can be detected in order to permit the computer system that includes the transportable memory apparatus to be appropriately initialized. As such, methods for initializing a computer system that may include a transportable memory apparatus are also advantageously provided.
According to one embodiment, a transportable memory apparatus capable of being relocated from a first computer system to a second computer system is provided. The transportable memory apparatus includes cache memory for at least temporarily storing data transferred between a host processor and a memory storage device, such as a plurality of disk drives. The transportable memory apparatus also includes a battery for providing auxiliary power to the cache memory. The transportable memory apparatus further includes a power source selector for selectively providing power from either a system power supply or from the battery. Typically, the power source selector provides the cache memory with power from the system power supply. However, if the power source selector detects that the system power has fallen below a minimum system threshold, cache memory can be provided with auxiliary power from the battery, especially in instances in which the cache memory includes dirty data.
In this regard, the transportable memory apparatus can include a voltage comparator module that includes a first comparator for comparing the system power to the minimum system threshold. If the voltage comparator determines that the system power has fallen below the minimum system threshold, the voltage comparator of this embodiment will signal the power source selector. The voltage computer module can also include a second comparator for comparing the auxiliary power provided by the battery to a minimum battery threshold and for signaling the power source selector if the auxiliary power does fall below the minimum battery threshold.
The transportable memory apparatus of this embodiment also includes a control bus for interconnecting the transportable memory apparatus with the host processor. The control bus includes a battery backup enable channel for enabling the battery to provide auxiliary power, typically in instances in which the cache memory is dirty. The control bus also includes an identification channel for providing an indication to the host controller that the transportable memory apparatus is present. The control bus can further include a battery backup mode channel for indicating if the battery is currently providing auxiliary power to the cache memory. As such, the host processor can detect the presence of the transportable memory apparatus and can determine the status of the transportable memory apparatus, either upon initialization of the computer system or at any time thereafter.
In this regard, a method for initializing a computer system is also provided that initially determines if a transportable memory module is present, such as by examining an identification line of the control bus interconnecting the transportable memory module with the computer system. If the transportable memory module is present, it is determined if the configuration information stored by the transportable memory module and the memory storage device are consistent. If the configuration information stored by the transportable memory module and the memory storage device are consistent, the data stored by the transportable memory module is flushed to the memory storage device. As such, the method of this aspect of the present invention permits the transportable memory module and the memory storage device, such as one or more disk drives, to be transported from a first computer system to a second computer system, such as in the event of a system power failure or a hardware failure in the first computer system, while still facilitating the flushing of dirty data from the transportable memory module to the memory storage device once installed in the second computer system. If the configuration information stored by the transportable memory module and the memory storage device are inconsistent, however, an error message is issued.
The method of this embodiment to the present invention also determines if the transportable memory module has been transported from one computer system to another computer system. In this regard, the method determines if the transportable memory module has been transported between computer systems by comparing the configuration information stored by the transportable memory module and the configuration information stored by the non-volatile memory device of the first computer system. If the configuration information stored by the transportable memory module and a non-volatile memory device are different, it is determined that the transportable memory module has been transported between computer systems. If, however, the configuration information stored by the transportable memory module and the non-volatile memory device match, it is determined that the transportable memory module has not been transported. If it is determined that the transportable memory module has been transported from one computer system to another computer system, and if the configuration information stored by the transportable memory module and the memory storage device are consistent, the configuration information of the non-volatile memory device is restored by copying the configuration information of the transportable memory module to the non-volatile memory device.
In addition, in embodiments in which the memory storage device includes a plurality of disks, the consistency of the disks can be checked prior to determining if the configuration information stored by the transportable memory module and the memory storage device are consistent. If the plurality of disks are inconsistent, an appropriate error message can be issued.
According to another embodiment to the present invention, a method for initializing a computer system is provided in which the memory controller is initialized in different manners depending upon the presence of a transportable memory module or a more conventional cache memory device. In this regard, the method initially determines if cache memory contains data that is dirty. If the cache memory contains data that is dirty, the method determines if a transportable memory module is present that includes the cache memory. Thereafter, the memory controller is initialized with values identifying the size and type of the cache memory. At least in instances in which the cache memory contains data that is dirty, the memory controller is initialized with values obtained from the cache memory if the transportable memory module is present and with values obtained from a non-volatile memory device if a transportable memory module is not present. Once the memory controller has been initialized, dirty data stored by the cache memory can be flushed to the memory storage device. If, however, cache memory does not contain data that is dirty, the cache memory can be examined to detect the size and type of the cache memory, which values are subsequently utilized to initialize the memory controller.
In order to provide auxiliary power to the cache memory, the computer system typically includes a battery. As such, cache memory may be determined to contain data that is dirty by examining the battery backup enable channel of the control bus interconnecting the memory controller and the cache memory. If the battery backup enable channel indicates that the battery is enabled, cache memory will be determined to contain data that is dirty. In addition, a flag stored by the non-volatile memory device may be utilized to indicate that cache memory contains data that is dirty. As such, the flag stored by the non-volatile memory device may be examined to determine if the cache memory contains data that is dirty.
The transportable memory apparatus of the present invention includes cache memory and a battery for providing auxiliary power to the cache memory such that the transportable memory apparatus can be moved from a first computer system and installed in the second computer system without losing or otherwise impairing the integrity of any data stored by the cache memory. The transportable memory apparatus is also designed to provide signals indicative of its presence and status to the host computer for use during initialization and the like. As such, methods for initializing the host computer are also provided that determine the presence and status of a transportable memory apparatus and that flush any dirty data that has been stored by the cache memory of the transportable memory apparatus. In this regard, a method that insures the consistency of the configuration information of the various memory devices prior to flushing the dirty data is provided. In addition, a method of initializing the memory controller of a host computer system with values identifying the size and type of the cache memory is provided that determines if a transportable memory module is present and then initializes the memory controller with values identifying the size and type of a cache memory in different manners depending upon the presence or absence of a transportable memory module. As such, the transportable memory apparatus and associated methods of the present invention provide for the storage and recovery of dirty data in instances in which the system power falls below a predetermined minimum level or the host computer suffers some type of hardware failure requiring that the cache memory be transported to another computer for recovery of the dirty data.